<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*
<span class='line'>  2</span>  * $Id: om-grid-roweditor.js,v 1.30 2012/06/27 05:24:03 chentianzhen Exp $
<span class='line'>  3</span>  * operamasks-ui omGrid @VERSION
<span class='line'>  4</span>  *
<span class='line'>  5</span>  * Copyright 2011, AUTHORS.txt (http://ui.operamasks.org/about)
<span class='line'>  6</span>  * Dual licensed under the MIT or LGPL Version 2 licenses.
<span class='line'>  7</span>  * http://ui.operamasks.org/license
<span class='line'>  8</span>  *
<span class='line'>  9</span>  * http://ui.operamasks.org/docs/
<span class='line'> 10</span>  * 
<span class='line'> 11</span>  * Depends:
<span class='line'> 12</span>  *  om-grid.js
<span class='line'> 13</span>  *  om-button.js
<span class='line'> 14</span>  */</span><span class="WHIT">
<span class='line'> 15</span> 
<span class='line'> 16</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">own</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Object.prototype.hasOwnProperty</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 20</span> 	 *  行编辑插件初始化监听器
<span class='line'> 21</span> 	 */</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">    </span><span class="NAME">$.omWidget.addInitListener</span><span class="PUNC">(</span><span class="STRN">'om.omGrid'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">    	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT">    		</span><span class="NAME">$elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT">    		</span><span class="NAME">ops</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">    		</span><span class="NAME">cm</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">    		</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">    	</span><span class="NAME">self._triggered</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="COMM">//是否已经触发过一次编辑了。</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">    	</span><span class="COMM">//如果所有列都不可编辑，那么_globalEditable=false,这时候所有原生的行都不可编辑，但如果此时设置了options.editMode=="insert",</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">    	</span><span class="COMM">//则新添加进来的行还是可以编辑的。</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">    	</span><span class="NAME">self._globalEditable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">    	</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">    	</span><span class="COMM">/**
<span class='line'> 34</span>     	 * &lt;span style='color:red'>(作用于行编辑插件)&lt;/span>编辑模式。
<span class='line'> 35</span>     	 * 可选值为"all","insert"，默认为"all"。"all"表示所有行都是可编辑的，但如果所有的列都是不可编辑的，那么行编辑插件仍然会失效。
<span class='line'> 36</span>     	 * 如果有这样的需求，所有的行都是不可编辑的，但是此表格可以动态添加新行，而且这些新行在持久化到后台之前是可以编辑的，那么就要使用"insert"模式了。 
<span class='line'> 37</span>     	 * @name omGrid#editMode
<span class='line'> 38</span>     	 * @type String
<span class='line'> 39</span>     	 * @default "all"
<span class='line'> 40</span>     	 * @example
<span class='line'> 41</span>     	 * $('.selector').omGrid({width : 600, editMode:"insert");
<span class='line'> 42</span>     	 */</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT">    	</span><span class="NAME">ops.editMode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ops.editMode</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"all"</span><span class="PUNC">;</span><span class="COMM">//默认为all模式，即所有行都可以编辑</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">    	</span><span class="NAME">self._allEditMode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ops.editMode</span><span class="PUNC">==</span><span class="STRN">"all"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">    		</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">    	</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">cm.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">    		</span><span class="NAME">self._globalEditable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cm</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="STRN">"editor"</span><span class="PUNC">]</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._globalEditable</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">    			</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">    	</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">    		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="COMM">//不开启编辑功能，该插件任何方法都会失效。</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">		</span><span class="NAME">self._editComps</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="COMM">//缓存每一列的编辑组件，key为colModel中的name,value为{model:模型,instance:组件实例,type:类型}</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">		</span><span class="NAME">self._errorHolders</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="COMM">//  name:div   每个编辑单元格对应的出错信息容器</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">		</span><span class="NAME">self._colWidthResize</span><span class="PUNC">;</span><span class="COMM">//如果grid可编辑，在拖动标题栏改变列宽时，当前并不处于编辑状态，则设置此值为true,这样在显示编辑条时由此依据要重新计算各个组件的宽度</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">		</span><span class="NAME">ops._onRefreshCallbacks.push</span><span class="PUNC">(</span><span class="NAME">_onRefresh</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//只有数据刷新后才可以进行初始化</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">		</span><span class="NAME">ops._onResizableCallbacks.push</span><span class="PUNC">(</span><span class="NAME">_onResizable</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">		</span><span class="NAME">ops._onResizeCallbacks.push</span><span class="PUNC">(</span><span class="NAME">_onResize</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//动态改变宽高时要重新计算编辑条的大小</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">        </span><span class="NAME">this.tbody.delegate</span><span class="PUNC">(</span><span class="STRN">'tr.om-grid-row'</span><span class="PUNC">,</span><span class="STRN">'dblclick'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT">        	</span><span class="NAME">editRenderer.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">        </span><span class="NAME">this.tbody.delegate</span><span class="PUNC">(</span><span class="STRN">'tr.om-grid-row'</span><span class="PUNC">,</span><span class="STRN">'click'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._triggered</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">self._editView.editing</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._validator</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">					</span><span class="NAME">self._validator.valid</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">editRenderer.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">					</span><span class="NAME">editRenderer.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">btnScrollTimer</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">        </span><span class="NAME">$elem.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">scroll</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._triggered</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">btnScrollTimer</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">        			</span><span class="NAME">clearTimeout</span><span class="PUNC">(</span><span class="NAME">btnScrollTimer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">        		</span><span class="NAME">btnScrollTimer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">    				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getEditBtnPosition</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">            		</span><span class="NAME">self._editView.editBtn.animate</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"left"</span><span class="PUNC">:</span><span class="NAME">pos.left</span><span class="PUNC">,</span><span class="STRN">"top"</span><span class="PUNC">:</span><span class="NAME">pos.top</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="NAME">self._editView.editing</span><span class="PUNC">?</span><span class="STRN">"fast"</span><span class="PUNC">:</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">            		</span><span class="NAME">btnScrollTimer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">    			</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">300</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'> 92</span> 	 	*  添加行编辑插件的接口
<span class='line'> 93</span> 	 	*/</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">	 	</span><span class="NAME">$.extend</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">	 		</span><span class="COMM">/** &lt;span style='color:red'>(作用于行编辑插件)。&lt;/span>取消编辑状态。如果当前某行正处于编辑状态，取消此次的行编辑，相当于点击了行编辑条的“取消”按钮。
<span class='line'> 96</span> 	 		 * @function 
<span class='line'> 97</span> 	 		 * @name omGrid#cancelEdit
<span class='line'> 98</span> 	 		 * @returns jQuery对象
<span class='line'> 99</span> 	 		 * @example
<span class='line'>100</span> 	 		 * $(".selector").omGrid("cancelEdit");
<span class='line'>101</span> 	 		 */</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">	 		</span><span class="NAME">cancelEdit</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">	 			</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">cancelBtn</span><span class="COMM">/*内部使用，当点击“按钮”也会调用此方法进行处理*/</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">	 				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$ev</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._editView</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">	 					</span><span class="NAME">ops</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">			    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this._triggered</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this._triggered</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">$ev.editing</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">			    		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT">			    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT">			    	</span><span class="NAME">$ev.view.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">			    	</span><span class="NAME">$ev.editing</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">			    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._rowAdding</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">			    		</span><span class="NAME">this.deleteRow</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">index</span><span class="PUNC">(</span><span class="NAME">this.tbody.find</span><span class="PUNC">(</span><span class="STRN">"tr[_grid_row_id='"</span><span class="PUNC">+</span><span class="NAME">self._editView.rowId</span><span class="PUNC">+</span><span class="STRN">"']"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">			    		</span><span class="NAME">this._rowAdding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">			    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT">					</span><span class="NAME">_resetForm</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT">					</span><span class="NAME">cancelBtn</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">cancelBtn</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">blur</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT">					</span><span class="NAME">ops.onCancelEdit</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">ops.onCancelEdit.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">	    	</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">	    	</span><span class="COMM">/** &lt;span style='color:red'>(作用于行编辑插件)。&lt;/span>取消当前所有未提交到后台的改变，也即恢复所有行的原始数据。
<span class='line'>121</span> 	    	 * @function
<span class='line'>122</span> 	    	 * @name omGrid#cancelChanges
<span class='line'>123</span> 	    	 * @returns jQuery对象
<span class='line'>124</span> 	    	 * @example
<span class='line'>125</span> 	    	 * $(".selector").omGrid("cancelChanges");
<span class='line'>126</span> 	    	 */</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">	    	</span><span class="NAME">cancelChanges</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">	    		</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">       	</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">	    			</span><span class="NAME">this.cancelEdit</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">		</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">	    			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">_noChanges</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">	    				</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT">	    			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">	    			</span><span class="NAME">_clearCache</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">	    			</span><span class="NAME">_resetForm</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">	    			</span><span class="NAME">this.refresh</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">	    </span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT">	    	</span><span class="COMM">/** &lt;span style='color:red'>(作用于行编辑插件)。&lt;/span>设置某一行进入编辑状态，如果此行正处于编辑状态中，则什么也不做。如果别的行正处于编辑状态中，则取消那一行此次编辑，然后本行进入编辑状态。 
<span class='line'>139</span> 	    	 * @function
<span class='line'>140</span> 	    	 * @param index 行索引，从0开始 
<span class='line'>141</span> 	    	 * @name omGrid#editRow
<span class='line'>142</span> 	    	 * @returns jQuery对象
<span class='line'>143</span> 	    	 * @example
<span class='line'>144</span> 	    	 * $(".selector").omGrid("editRow" , 1);
<span class='line'>145</span> 	    	 */</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT">	    	</span><span class="NAME">editRow</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT">	    			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">	    		</span><span class="NAME">editRenderer.call</span><span class="PUNC">(</span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">eq</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT">	    	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">	    	</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">	    	</span><span class="COMM">/** &lt;span style='color:red'>(作用于行编辑插件)。&lt;/span>删除行，如果指定行是新添加的并未保存到后台，则进行物理删除；如果指定行是原本就存在的，则只是隐藏并进行标记,当调用了saveChanges后才进行物理删除。
<span class='line'>154</span> 	    	 * @function
<span class='line'>155</span> 	    	 * @param index 行索引，从0开始；或者为行索引数组(一般由getSelections得到)
<span class='line'>156</span> 	    	 * @name omGrid#deleteRow
<span class='line'>157</span> 	    	 * @returns jQuery对象
<span class='line'>158</span> 	    	 * @example
<span class='line'>159</span> 	    	 * $(".selector").omGrid("deleteRow" , 0);&lt;br />
<span class='line'>160</span> 	    	 * 或者$(".selector").omGrid("deleteRow" , $(".selector").omGrid("getSelections"));
<span class='line'>161</span> 	    	 */</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT">	    	</span><span class="NAME">deleteRow</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this._triggered</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this._editView.editing</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>166</span> 
<span class='line'>167</span> </span><span class="WHIT">	    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$trs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT">	    			</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">$.isArray</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT">	    			</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">				</span><span class="NAME">index.sort</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">first</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">second</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">second</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">first</span><span class="PUNC">;</span><span class="COMM">//从大到小</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">				</span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT">					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$trs.eq</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT">						</span><span class="NAME">$next</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$tr.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">						</span><span class="NAME">rowId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT">		    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$tr.attr</span><span class="PUNC">(</span><span class="STRN">"_insert"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT">		    			</span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">self._changeData</span><span class="PUNC">[</span><span class="STRN">"insert"</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT">		    			</span><span class="NAME">$tr.remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">		    			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$next.hasClass</span><span class="PUNC">(</span><span class="STRN">"rowExpand-rowDetails"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//行详情</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">		    				</span><span class="NAME">$next.remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">		    			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">		    		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">		    			</span><span class="NAME">self._changeData</span><span class="PUNC">[</span><span class="STRN">"delete"</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._rowIdDataMap</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT">		    			</span><span class="NAME">$tr.attr</span><span class="PUNC">(</span><span class="STRN">"_delete"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"true"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">		    			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$next.hasClass</span><span class="PUNC">(</span><span class="STRN">"rowExpand-rowDetails"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//行详情</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">		        			</span><span class="NAME">$next.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">		        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">		        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT">				</span><span class="NAME">this._refreshHeaderCheckBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">	        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">	 </span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">	        </span><span class="COMM">/** &lt;span style='color:red'>(作用于行编辑插件)。&lt;/span>获取所有未保存的修改。如果没有指定type,返回的是所有的修改，格式为: {update:[],insert:[],delete:[]}，如果指定了参数，如
<span class='line'>198</span> 	    	 *  指定了"update"，则返回 [{},{}]
<span class='line'>199</span> 	    	 * @function
<span class='line'>200</span> 	    	 * @param type 可选值为："insert","update","delete" 
<span class='line'>201</span> 	    	 * @name omGrid#getChanges
<span class='line'>202</span> 	    	 * @returns 若指定了类型，返回[]，否则返回{update:[],insert:[],delete:[]}
<span class='line'>203</span> 	    	 * @example
<span class='line'>204</span> 	    	 * $(".selector").omGrid("getChanges" , "update");
<span class='line'>205</span> 	    	 */</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">	    	</span><span class="NAME">getChanges</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">	    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">data</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"update"</span><span class="PUNC">:</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"insert"</span><span class="PUNC">:</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"delete"</span><span class="PUNC">:</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">	    			</span><span class="NAME">reqType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"update"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT">	    			</span><span class="NAME">cData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._changeData</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">	    			</span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT">	    			</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">reqType</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"update"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">	    			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">uData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cData</span><span class="PUNC">[</span><span class="NAME">reqType</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">	    			</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">uData</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">	    				</span><span class="NAME">own.call</span><span class="PUNC">(</span><span class="NAME">uData</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">reqType</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">push</span><span class="PUNC">(</span><span class="NAME">$.extend</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this._rowIdDataMap</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">uData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">	    			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">	    			</span><span class="NAME">reqType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"insert"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">reqType</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"insert"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT">	    			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cData</span><span class="PUNC">[</span><span class="NAME">reqType</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT">	    			</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">iData</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT">	    				</span><span class="NAME">own.call</span><span class="PUNC">(</span><span class="NAME">iData</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">reqType</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">push</span><span class="PUNC">(</span><span class="NAME">iData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT">	    			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT">	    			</span><span class="NAME">reqType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"delete"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">reqType</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"delete"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">	    			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cData</span><span class="PUNC">[</span><span class="NAME">reqType</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">	    			</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">dData</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">	    				</span><span class="NAME">own.call</span><span class="PUNC">(</span><span class="NAME">dData</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">reqType</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">push</span><span class="PUNC">(</span><span class="NAME">dData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">	    			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">	    			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">	    			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT">	    	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">	 </span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">		 	</span><span class="COMM">/** &lt;span style='color:red'>(作用于行编辑插件)。&lt;/span>在指定位置动态插入一行。
<span class='line'>240</span> 	    	 * @function
<span class='line'>241</span> 	    	 * @param index 行索引，从0开始，或为"begin","end"分别表示在表格最前和最后插入行。
<span class='line'>242</span> 	    	 * @param rowData 插入的新行的初始值
<span class='line'>243</span> 	    	 * @param forceAdd 强制添加，设为true表示直接添加，不会弹出编辑框
<span class='line'>244</span> 	    	 * @name omGrid#insertRow
<span class='line'>245</span> 	    	 * @returns jQuery对象
<span class='line'>246</span> 	    	 * @example
<span class='line'>247</span> 	    	 * $(".selector").omGrid("insertRow");//插入最前面&lt;br/>
<span class='line'>248</span> 	    	 * $(".selector").omGrid("insertRow" , 1);//插入索引1的位置&lt;br/>
<span class='line'>249</span> 	    	 * $(".selector").omGrid("insertRow" , "end" , {id:"1"});//在末尾插入，并使用指定数据初始化&lt;br/>
<span class='line'>250</span> 	    	 * $(".selector").omGrid("insertRow" , true);//插入最前面，并直接添加，不显示编辑框&lt;br/>
<span class='line'>251</span> 	    	 * $(".selector").omGrid("insertRow" , 0 , {id:"2"} , true);//用指定数据在最前面插入新行，并且不显示编辑框&lt;br/>
<span class='line'>252</span> 	    	 */</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">	    	</span><span class="NAME">insertRow</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">forceAdd</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT">	    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ops</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">	    			</span><span class="NAME">cm</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">	    			</span><span class="NAME">$elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">	    		</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this._rowAdding</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT">	    			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">	    		</span><span class="COMM">//insertRow({id:10})</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$.isPlainObject</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT">	    			</span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT">	    			</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT">	    		</span><span class="COMM">//insertRow(true)</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT">	    			</span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">	    			</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT">	    			</span><span class="NAME">forceAdd</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">	    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$trs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">	    			</span><span class="NAME">rd</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT">	    		</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"begin"</span><span class="PUNC">==</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">==</span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">"end"</span><span class="PUNC">==</span><span class="NAME">index</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">$trs.length</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT">	    </span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT">	    		</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">cm.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT">	    			</span><span class="NAME">rd</span><span class="PUNC">[</span><span class="NAME">cm</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="STRN">"name"</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="COMM">//默认都为空值</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT">	        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">	    		</span><span class="NAME">this._changeData</span><span class="PUNC">[</span><span class="STRN">"insert"</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">this._guid</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.extend</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rd</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">	    		</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">	    		</span><span class="COMM">//创建新行</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT">	    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rowValues</span><span class="PUNC">=</span><span class="NAME">this._buildRowCellValues</span><span class="PUNC">(</span><span class="NAME">cm</span><span class="PUNC">,</span><span class="NAME">rd</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">	    			</span><span class="NAME">trContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">	    			</span><span class="NAME">rowClasses</span><span class="PUNC">=</span><span class="NAME">ops.rowClasses</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">	    			</span><span class="NAME">isRowClassesFn</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">rowClasses</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">	    			</span><span class="NAME">rowCls</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isRowClassesFn</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">rowClasses</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">rd</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="NAME">rowClasses</span><span class="PUNC">[</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NAME">rowClasses.length</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">	    			</span><span class="NAME">tdTmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"&lt;td align='$' abbr='$' class='grid-cell-dirty $'>&lt;div align='$' class='$' style='width:$px'>$&lt;/div>&lt;/td>"</span><span class="PUNC">;</span><span class="COMM">//td模板</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">	    			    			</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">	    		</span><span class="NAME">trContent.push</span><span class="PUNC">(</span><span class="STRN">"&lt;tr class='om-grid-row "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">rowCls</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"' _grid_row_id="</span><span class="PUNC">+</span><span class="PUNC">(</span><span class="NAME">this._guid</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="STRN">" _insert='true'>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT">	    		</span><span class="NAME">this._getHeaderCols</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT">	                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'axis'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT">	                	</span><span class="NAME">wrap</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT">	                	</span><span class="NAME">html</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT">	                	</span><span class="NAME">cols</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">	                	</span><span class="NAME">j</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">	                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'indexCol'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">	                    </span><span class="NAME">html</span><span class="PUNC">=</span><span class="STRN">"&lt;a class='om-icon'>新行&lt;/a>"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">	                </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'checkboxCol'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">	                    </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'&lt;span class="checkbox"/>'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">	                </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">axis.substring</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">3</span><span class="PUNC">)</span><span class="PUNC">==</span><span class="STRN">'col'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">	                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">colIndex</span><span class="PUNC">=</span><span class="NAME">axis.substring</span><span class="PUNC">(</span><span class="NUMB">3</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT">	                    </span><span class="NAME">html</span><span class="PUNC">=</span><span class="NAME">rowValues</span><span class="PUNC">[</span><span class="NAME">colIndex</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT">	                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">cm</span><span class="PUNC">[</span><span class="NAME">colIndex</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">wrap</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT">							</span><span class="NAME">wrap</span><span class="PUNC">=</span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT">						</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT">	                </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT">	                    </span><span class="NAME">html</span><span class="PUNC">=</span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT">	                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT">	                </span><span class="NAME">cols</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.align</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.abbr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.align</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">wrap</span><span class="PUNC">?</span><span class="STRN">'wrap'</span><span class="PUNC">:</span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'div'</span><span class="PUNC">,</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT">	                </span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT">	                </span><span class="NAME">trContent.push</span><span class="PUNC">(</span><span class="NAME">tdTmp.replace</span><span class="PUNC">(</span><span class="REGX">/\$/g</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT">	                	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">cols</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT">	                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT">	            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT">	            </span><span class="NAME">trContent.push</span><span class="PUNC">(</span><span class="STRN">"&lt;/tr>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">	    		</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT">	    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">trContent.join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT">	    			</span><span class="NAME">$destTr</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT">	    			</span><span class="NAME">$next</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">==</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT">	    			</span><span class="NAME">$tr.prependTo</span><span class="PUNC">(</span><span class="NAME">$elem.find</span><span class="PUNC">(</span><span class="STRN">">tbody"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT">	    			</span><span class="NAME">$destTr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$trs.eq</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT">	    			</span><span class="NAME">$next</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$destTr.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>325</span> </span><span class="WHIT">	    			</span><span class="NAME">$destTr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$next.hasClass</span><span class="PUNC">(</span><span class="STRN">"rowExpand-rowDetails"</span><span class="PUNC">)</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">$next</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">$destTr</span><span class="PUNC">;</span><span class="COMM">//处理行详情</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT">	    			</span><span class="NAME">$destTr.after</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">forceAdd</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>329</span> </span><span class="WHIT">	    			</span><span class="NAME">this.editRow</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT">	    			</span><span class="COMM">//正在添加新行标志，如果这时候校验通不过，新增行在编辑正确并保存之前双击其它行是没有反应的。此外，如果用户点击取消，这时候会删除新增的行,在第一次点击"保存"按钮时要设置此值为false。</span><span class="WHIT">
<span class='line'>331</span> </span><span class="WHIT">	    			</span><span class="NAME">this._rowAdding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>332</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>333</span> </span><span class="WHIT">	    	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>334</span> </span><span class="WHIT">	    	</span><span class="WHIT">
<span class='line'>335</span> </span><span class="WHIT">	    	</span><span class="COMM">/** &lt;span style='color:red'>(作用于行编辑插件)。&lt;/span>保存客户端数据。注意，此方法不会提交请求到后台，而是会认为所有的数据改变都已经成功提交到后台去了，所以它会清除所有脏数据标志。
<span class='line'>336</span> 	    	 * 一般情况下，在您自己的保存方法事件回调中，调用getChanges方法获取当前所有的改变，并自己提交到后台，然后在成功回调方法中再调用本方法。
<span class='line'>337</span> 	    	 * 一旦调用本方法后，cancelChanges方法是无法对调用此方法前的所有改变起作用的。
<span class='line'>338</span> 	    	 * @function
<span class='line'>339</span> 	    	 * @name omGrid#saveChanges
<span class='line'>340</span> 	    	 * @returns jQuery对象
<span class='line'>341</span> 	    	 * @example
<span class='line'>342</span> 	    	 * $(".selector").omGrid("saveChanges");
<span class='line'>343</span> 	    	 */</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT">	    	</span><span class="NAME">saveChanges</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT">	    		</span><span class="NAME">this.cancelEdit</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">_noChanges</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">uData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._changeData</span><span class="PUNC">[</span><span class="STRN">"update"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT">					</span><span class="NAME">$trs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element.find</span><span class="PUNC">(</span><span class="STRN">"tr.om-grid-row"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT">					</span><span class="NAME">newRowsData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT">				</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">uData</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">own.call</span><span class="PUNC">(</span><span class="NAME">uData</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT">						</span><span class="NAME">$.extend</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this._rowIdDataMap</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">uData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>358</span> </span><span class="WHIT">				</span><span class="NAME">$trs.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT">					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$tr.attr</span><span class="PUNC">(</span><span class="STRN">"_delete"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT">						</span><span class="NAME">$tr.remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT">						</span><span class="NAME">newRowsData.push</span><span class="PUNC">(</span><span class="NAME">_getRowData</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>365</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT">				</span><span class="NAME">this.pageData.data.rows</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newRowsData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT">				</span><span class="NAME">_clearCache</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT">				</span><span class="NAME">_resetForm</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//重置编辑表单，清除错误信息</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT">				</span><span class="NAME">this.refresh</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//重用dataSource中的数据进行刷新</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">	    	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT">	    	</span><span class="COMM">/**
<span class='line'>372</span>              * 编辑一行之前执行的方法。
<span class='line'>373</span>              * @event
<span class='line'>374</span>              * @name omGrid#onBeforeEdit
<span class='line'>375</span>              * @param rowIndex 行号（从0开始）
<span class='line'>376</span>              * @param rowData 选择的行所代表的JSON对象
<span class='line'>377</span>              * @default 无
<span class='line'>378</span>              * @example
<span class='line'>379</span>              *  $(".selector").omGrid({
<span class='line'>380</span>              *      onBeforeEdit:function(rowIndex , rowData){
<span class='line'>381</span>              *          alert("您将编辑的记录索引为:" + rowIndex);
<span class='line'>382</span>              *      }
<span class='line'>383</span>              *  });
<span class='line'>384</span>              */</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT">             </span><span class="NAME">onBeforeEdit</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rowIndex</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT">             </span><span class="COMM">/**
<span class='line'>387</span>              * 编辑一行之后执行的方法。
<span class='line'>388</span>              * @event
<span class='line'>389</span>              * @name omGrid#onAfterEdit
<span class='line'>390</span>              * @param rowIndex 行号（从0开始）
<span class='line'>391</span>              * @param rowData 选择的行所代表的JSON对象
<span class='line'>392</span>              * @default 无
<span class='line'>393</span>              * @example
<span class='line'>394</span>              *  $(".selector").omGrid({
<span class='line'>395</span>              *      onAfterEdit:function(rowIndex , rowData){
<span class='line'>396</span>              *          alert("您刚刚编辑的记录索引为:" + rowIndex);
<span class='line'>397</span>              *      }
<span class='line'>398</span>              *  });
<span class='line'>399</span>              */</span><span class="WHIT">
<span class='line'>400</span> </span><span class="WHIT">             </span><span class="NAME">onAfterEdit</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rowIndex</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>401</span> </span><span class="WHIT">             </span><span class="COMM">/**
<span class='line'>402</span>              * 取消编辑一行时执行的方法。
<span class='line'>403</span>              * @event
<span class='line'>404</span>              * @name omGrid#onCancelEdit
<span class='line'>405</span>              * @default 无
<span class='line'>406</span>              * @example
<span class='line'>407</span>              *  $(".selector").omGrid({
<span class='line'>408</span>              *      onCancelEdit:function(){
<span class='line'>409</span>              *          alert("您取消了编辑状态");
<span class='line'>410</span>              *      }
<span class='line'>411</span>              *  });
<span class='line'>412</span>              */</span><span class="WHIT">
<span class='line'>413</span> </span><span class="WHIT">             </span><span class="NAME">onCancelEdit</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>414</span> </span><span class="WHIT">	    	</span><span class="COMM">/**
<span class='line'>415</span> 	    	 * (覆盖)获取最新的所有数据
<span class='line'>416</span> 	    	 */</span><span class="WHIT">
<span class='line'>417</span> </span><span class="WHIT">	    	</span><span class="NAME">getData</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>418</span> </span><span class="WHIT">	    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.pageData.data</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT">					</span><span class="NAME">$trs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT">					</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT">					</span><span class="WHIT">
<span class='line'>422</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">_hasChange</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT">	    			</span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">total</span><span class="PUNC">:</span><span class="NAME">result.total</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT">	    			</span><span class="NAME">result.rows</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT">					</span><span class="NAME">$trs.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>426</span> </span><span class="WHIT">	    				</span><span class="NAME">result.rows.push</span><span class="PUNC">(</span><span class="NAME">self._getRowData</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>427</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>428</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>429</span> </span><span class="WHIT">				</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT">	    	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT">	    	</span><span class="COMM">/**
<span class='line'>432</span> 	    	 * (覆盖)获取最新的行数据。由于可以插入新的数据行，所以此方法要进行重写。
<span class='line'>433</span> 	    	 */</span><span class="WHIT">
<span class='line'>434</span> </span><span class="WHIT">	    	</span><span class="NAME">_getRowData</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>435</span> </span><span class="WHIT">	    		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">eq</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>436</span> </span><span class="WHIT">	    			</span><span class="NAME">rowId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT">	    			</span><span class="NAME">rowData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">_noChanges</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">	    			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.pageData.data.rows</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">	    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$tr.attr</span><span class="PUNC">(</span><span class="STRN">"_insert"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">	    			</span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._changeData.insert</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">	    			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">origRowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._rowIdDataMap</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">	    				</span><span class="NAME">uData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._changeData</span><span class="PUNC">[</span><span class="STRN">"update"</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">	    			</span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">origRowData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT">	    			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">uData</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>448</span> </span><span class="WHIT">	    				</span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.extend</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">origRowData</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">uData</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>449</span> </span><span class="WHIT">	    			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>450</span> </span><span class="WHIT">	    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>451</span> </span><span class="WHIT">	    		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>452</span> </span><span class="WHIT">	    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT">	 	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>456</span> </span><span class="WHIT">    </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">editRenderer</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>457</span> </span><span class="WHIT">    	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT">    		</span><span class="NAME">$elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">    		</span><span class="NAME">$editRow</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">    		</span><span class="NAME">$editForm</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">    		</span><span class="NAME">scrollLeft</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">    		</span><span class="NAME">cm</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">    		</span><span class="NAME">editComp</span><span class="PUNC">,</span><span class="COMM">//{name:{type:组件类型,model:列对应model,instance:组件实例}}</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">    		</span><span class="NAME">lastValue</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">    		</span><span class="NAME">ops</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">    	</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT">    		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">    		</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">    	</span><span class="COMM">//如果是insertEditMode模式，那么除非该行是新增的，否则不可编辑，直接返回</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT">    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">self._allEditMode</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">$tr.attr</span><span class="PUNC">(</span><span class="STRN">"_insert"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT">    		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>475</span> </span><span class="WHIT">    	</span><span class="WHIT">
<span class='line'>476</span> </span><span class="WHIT">    	</span><span class="COMM">//当前行正处于编辑状态，直接返回</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT">    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._triggered</span><span class="WHIT">  </span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">    		</span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">self._editView.editing</span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT">    		</span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">self._editView.rowId</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>480</span> </span><span class="WHIT">			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">        		</span><span class="WHIT">
<span class='line'>481</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>482</span> </span><span class="WHIT">    	</span><span class="WHIT">
<span class='line'>483</span> </span><span class="WHIT">    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._rowAdding</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//处于新增行编辑中，在新增行第一次保存前此方法不响应。</span><span class="WHIT">
<span class='line'>484</span> </span><span class="WHIT">    		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT">    	</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT">    	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">index</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>488</span> </span><span class="WHIT">    		</span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getRowData</span><span class="PUNC">(</span><span class="NAME">rowIndex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>489</span> </span><span class="WHIT">    		</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT">    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">ops.onBeforeEdit</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">ops.onBeforeEdit.call</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>491</span> </span><span class="WHIT">    		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>492</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>493</span> </span><span class="WHIT">    	</span><span class="NAME">_showEditView</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT">    	</span><span class="NAME">$editRow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._editView.editRow</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>495</span> </span><span class="WHIT">    	</span><span class="NAME">$editForm</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$editRow.find</span><span class="PUNC">(</span><span class="STRN">">.grid-edit-form"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>496</span> </span><span class="WHIT">    	</span><span class="NAME">scrollLeft</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">scrollLeft</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>497</span> </span><span class="WHIT">    	</span><span class="WHIT">
<span class='line'>498</span> </span><span class="WHIT">    	</span><span class="NAME">self._getHeaderCols</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>499</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'axis'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>500</span> </span><span class="WHIT">				</span><span class="NAME">model</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>501</span> </span><span class="WHIT">				</span><span class="NAME">$cell</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$tr.find</span><span class="PUNC">(</span><span class="STRN">"td:eq("</span><span class="PUNC">+</span><span class="NAME">index</span><span class="PUNC">+</span><span class="STRN">")"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>502</span> </span><span class="WHIT">				</span><span class="NAME">name</span><span class="PUNC">,</span><span class="COMM">//编辑组件input域的名字，这是校验所必需的</span><span class="WHIT">
<span class='line'>503</span> </span><span class="WHIT">				</span><span class="NAME">compKey</span><span class="PUNC">;</span><span class="COMM">//指editComps的key</span><span class="WHIT">
<span class='line'>504</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">axis.substring</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">3</span><span class="PUNC">)</span><span class="PUNC">==</span><span class="STRN">'col'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT">             	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">colIndex</span><span class="PUNC">=</span><span class="NAME">axis.substring</span><span class="PUNC">(</span><span class="NUMB">3</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT">             	</span><span class="NAME">model</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cm</span><span class="PUNC">[</span><span class="NAME">colIndex</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$.isEmptyObject</span><span class="PUNC">(</span><span class="NAME">self._editComps</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//保证再次编辑其它行时不会重复添加 padding-left.</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT">        			</span><span class="NAME">$editRow.css</span><span class="PUNC">(</span><span class="STRN">"padding-left"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">$editRow.css</span><span class="PUNC">(</span><span class="STRN">"padding-left"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">$cell.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT">        		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">editor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">model.editor</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">self._triggered</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT">        		</span><span class="COMM">//如果列不可编辑，则默认type="text"</span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT">            	</span><span class="COMM">//列不可编辑的条件: </span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT">            	</span><span class="COMM">//(1)colModel没有editor属性</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">            	</span><span class="COMM">//(2)colModel有editor属性，并且editor有editable属性，那么editable===false则不进行编辑，或者editable为函数且返回false也不进行编辑。</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">editor</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>520</span> </span><span class="WHIT">	            	</span><span class="PUNC">(</span><span class="NAME">editor</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>521</span> </span><span class="WHIT">	            		</span><span class="PUNC">(</span><span class="NAME">editor.editable</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">	                    	</span><span class="PUNC">(</span><span class="NAME">$.isFunction</span><span class="PUNC">(</span><span class="NAME">editor.editable</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">editor.editable</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>523</span> </span><span class="WHIT">					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editor</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">editor.renderer</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT">	       			</span><span class="NAME">model.editor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT">	       			</span><span class="NAME">editor.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"text"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT">	       			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">renderer</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>527</span> </span><span class="WHIT">	       				</span><span class="NAME">editor.renderer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>528</span> </span><span class="WHIT">	       				</span><span class="NAME">editor.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"custom"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>529</span> </span><span class="WHIT">	       			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT">	       			</span><span class="NAME">editor.editable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>531</span> </span><span class="WHIT">	   			</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>532</span> </span><span class="WHIT">	   				</span><span class="NAME">editor.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editor.type</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"text"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>533</span> </span><span class="WHIT">	   				</span><span class="NAME">editor.editable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>534</span> </span><span class="WHIT">	   				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">editor.rules</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>535</span> </span><span class="WHIT">	   					</span><span class="NAME">self._validate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="COMM">//只有需要检验才需要进行检验</span><span class="WHIT">
<span class='line'>536</span> </span><span class="WHIT">	   				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>537</span> </span><span class="WHIT">	   			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>538</span> </span><span class="WHIT">	   			</span><span class="NAME">compKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">model.editor.name</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">model.name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>539</span> </span><span class="WHIT">	   			</span><span class="NAME">editor.options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editor.options</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT">	   			</span><span class="NAME">self._editComps</span><span class="PUNC">[</span><span class="NAME">compKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT">        		</span><span class="NAME">compKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">model.editor.name</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">model.name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">        	</span><span class="NAME">editComp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._editComps</span><span class="PUNC">[</span><span class="NAME">compKey</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">   			</span><span class="NAME">lastValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">lastValue</span><span class="PUNC">=</span><span class="NAME">_getLastValue</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">model</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">==</span><span class="NAME">undefined</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">:</span><span class="NAME">lastValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">   			</span><span class="WHIT">
<span class='line'>547</span> </span><span class="WHIT">   			</span><span class="COMM">//可编辑并且可校验，添加对应的出错信息显示容器</span><span class="WHIT">
<span class='line'>548</span> </span><span class="WHIT">   			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">self._triggered</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">editor.editable</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">editor.rules</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>549</span> </span><span class="WHIT">   				</span><span class="NAME">self._errorHolders</span><span class="PUNC">[</span><span class="NAME">compKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;div class='errorContainer' style='display:none'>&lt;/div>"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">$elem.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>550</span> </span><span class="WHIT">   			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>551</span> </span><span class="WHIT">   			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$ins</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editComp.instance</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>552</span> </span><span class="WHIT">   				</span><span class="NAME">$wrapper</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>553</span> </span><span class="WHIT">   				</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editor.type</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>554</span> </span><span class="WHIT">   			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">$ins</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>555</span> </span><span class="WHIT">   				</span><span class="NAME">$wrapper</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;div style='position:absolute'>&lt;/div>"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">left</span><span class="PUNC">:</span><span class="NAME">$cell.position</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">left</span><span class="PUNC">+</span><span class="NAME">scrollLeft</span><span class="PUNC">,</span><span class="NAME">top</span><span class="PUNC">:</span><span class="NUMB">3</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">$editForm</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"grid-edit-wrapper"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>556</span> </span><span class="WHIT">   				</span><span class="NAME">$ins</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editComp.instance</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;input>&lt;/input>"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"name"</span><span class="PUNC">:</span><span class="NAME">compKey</span><span class="PUNC">,</span><span class="STRN">"id"</span><span class="PUNC">:</span><span class="NAME">compKey</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">$wrapper</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>557</span> </span><span class="WHIT">   				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="STRN">"text"</span><span class="PUNC">!=</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="STRN">"custom"</span><span class="PUNC">!=</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//实例化组件</span><span class="WHIT">
<span class='line'>558</span> </span><span class="WHIT">   					</span><span class="NAME">$ins</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">]</span><span class="PUNC">(</span><span class="NAME">editor.options</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>559</span> </span><span class="WHIT">   				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>560</span> </span><span class="WHIT">   				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="STRN">"omCalendar"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"omCombo"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>561</span> </span><span class="WHIT">   					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$parent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$ins.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>562</span> </span><span class="WHIT">   					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="STRN">"omCalendar"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>563</span> </span><span class="WHIT">   						</span><span class="NAME">$ins.val</span><span class="PUNC">(</span><span class="NAME">lastValue</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">$cell.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="NUMB">24</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>564</span> </span><span class="WHIT">   						</span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="NAME">$cell.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$parent.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>565</span> </span><span class="WHIT">   					</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>566</span> </span><span class="WHIT">   						</span><span class="COMM">//omCombo由于原来的input被隐藏了，为了可以校验，要把id和name移到显示的那个代理input</span><span class="WHIT">
<span class='line'>567</span> </span><span class="WHIT">						</span><span class="NAME">$ins.next</span><span class="PUNC">(</span><span class="STRN">"input"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">id</span><span class="PUNC">:</span><span class="NAME">$ins.prop</span><span class="PUNC">(</span><span class="STRN">"id"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="NAME">$ins.prop</span><span class="PUNC">(</span><span class="STRN">"name"</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>568</span> </span><span class="WHIT">						</span><span class="NAME">$ins.attr</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">id</span><span class="PUNC">:</span><span class="STRN">""</span><span class="PUNC">,</span><span class="NAME">name</span><span class="PUNC">:</span><span class="STRN">""</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>569</span> </span><span class="WHIT">						</span><span class="NAME">$ins.next</span><span class="PUNC">(</span><span class="STRN">"input"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">$cell.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$parent.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$ins.next</span><span class="PUNC">(</span><span class="STRN">"input"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">		</span><span class="WHIT">
<span class='line'>570</span> </span><span class="WHIT">   					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>571</span> </span><span class="WHIT">   				</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>572</span> </span><span class="WHIT">   					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="STRN">"text"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>573</span> </span><span class="WHIT">   						</span><span class="NAME">$ins.addClass</span><span class="PUNC">(</span><span class="STRN">"grid-edit-text"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>574</span> </span><span class="WHIT">   						</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">editor.editable</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>575</span> </span><span class="WHIT">   							</span><span class="NAME">$ins.attr</span><span class="PUNC">(</span><span class="STRN">"readonly"</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"readonly"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"readonly-text"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>576</span> </span><span class="WHIT">   						</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>577</span> </span><span class="WHIT">   					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>578</span> </span><span class="WHIT">   					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="STRN">"custom"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>579</span> </span><span class="WHIT">   						</span><span class="NAME">$ins</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editComp.instance</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$wrapper.html</span><span class="PUNC">(</span><span class="NAME">editor.renderer.call</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">lastValue</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>580</span> </span><span class="WHIT">   					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>581</span> </span><span class="WHIT">   					</span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="NAME">$cell.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$ins.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>582</span> </span><span class="WHIT">   				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>583</span> </span><span class="WHIT">   				</span><span class="NAME">editComp.model</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">model</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>584</span> </span><span class="WHIT">				</span><span class="NAME">editComp.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>585</span> </span><span class="WHIT">				</span><span class="NAME">editComp.id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">model.name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>586</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="STRN">"custom"</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//非"custom"类型失去焦点要隐藏错误信息</span><span class="WHIT">
<span class='line'>587</span> </span><span class="WHIT">					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$target</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"omCombo"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">$ins.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">$ins</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>588</span> </span><span class="WHIT">					</span><span class="NAME">$target.blur</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>589</span> </span><span class="WHIT">						</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">eHolder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._errorHolders</span><span class="PUNC">[</span><span class="NAME">compKey</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>590</span> </span><span class="WHIT">						</span><span class="NAME">eHolder</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">eHolder.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>591</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>592</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>593</span> </span><span class="WHIT">   			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>594</span> </span><span class="WHIT">			</span><span class="KEYW">switch</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>595</span> </span><span class="WHIT">				</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"omCalendar"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>596</span> </span><span class="WHIT">					</span><span class="NAME">$ins</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$ins.val</span><span class="PUNC">(</span><span class="NAME">lastValue</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">omCalendar</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>597</span> </span><span class="WHIT">					</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>598</span> </span><span class="WHIT">				</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"omNumberField"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>599</span> </span><span class="WHIT">					</span><span class="NAME">$ins.val</span><span class="PUNC">(</span><span class="NAME">lastValue</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">trigger</span><span class="PUNC">(</span><span class="STRN">"blur"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//进行错误处理</span><span class="WHIT">
<span class='line'>600</span> </span><span class="WHIT">					</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>601</span> </span><span class="WHIT">				</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"omCombo"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>602</span> </span><span class="WHIT">					</span><span class="NAME">$ins.omCombo</span><span class="PUNC">(</span><span class="STRN">"value"</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">lastValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>603</span> </span><span class="WHIT">					</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>604</span> </span><span class="WHIT">				</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"text"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>605</span> </span><span class="WHIT">					</span><span class="NAME">$ins.val</span><span class="PUNC">(</span><span class="NAME">lastValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>606</span> </span><span class="WHIT">					</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>607</span> </span><span class="WHIT">				</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"custom"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>608</span> </span><span class="WHIT">					</span><span class="NAME">$ins.html</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">editor.renderer.call</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">lastValue</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>609</span> </span><span class="WHIT">				</span><span class="KEYW">default</span><span class="PUNC">:</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>610</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>612</span> </span><span class="WHIT">        </span><span class="PUNC">!</span><span class="NAME">self._triggered</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">self._validate</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">_bindValidation</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>613</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT">        </span><span class="NAME">self._validator</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">self._validator.form</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//触发校验</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT">    	</span><span class="NAME">self._triggered</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>619</span>      * 清除更改数据缓存
<span class='line'>620</span>      */</span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT">    </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_clearCache</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>622</span> </span><span class="WHIT">    	</span><span class="NAME">self._changeData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"update"</span><span class="PUNC">:</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="STRN">"insert"</span><span class="PUNC">:</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="STRN">"delete"</span><span class="PUNC">:</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>623</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>625</span> </span><span class="WHIT">    </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_noChanges</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>626</span> </span><span class="WHIT">    	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">_hasChange</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>627</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>628</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>629</span> </span><span class="WHIT">    </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_getEditBtnPosition</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>630</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>631</span> </span><span class="WHIT">			</span><span class="NAME">$bDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>632</span> </span><span class="WHIT">			</span><span class="NAME">ev</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._editView</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>633</span> </span><span class="WHIT">			</span><span class="NAME">$editView</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ev.view</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>634</span> </span><span class="WHIT">			</span><span class="NAME">$editBtn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ev.editBtn</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>635</span> </span><span class="WHIT">			</span><span class="NAME">$editRow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ev.editRow</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>636</span> </span><span class="WHIT">			</span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>637</span> </span><span class="WHIT">			</span><span class="WHIT">
<span class='line'>638</span> </span><span class="WHIT">		</span><span class="NAME">pos.top</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$editRow.height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>639</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$elem.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">$bDiv.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>640</span> </span><span class="WHIT">			</span><span class="NAME">pos.left</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$editBtn.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>641</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>642</span> </span><span class="WHIT">			</span><span class="NAME">pos.left</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$bDiv.scrollLeft</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">$bDiv.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$editBtn.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>643</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>644</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">pos</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>645</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>646</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>647</span> </span><span class="WHIT">    </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_onRefresh</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>648</span> </span><span class="WHIT">    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>649</span> </span><span class="WHIT">    		</span><span class="NAME">_clearCache</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>650</span> </span><span class="WHIT">    		</span><span class="NAME">_buildRowIdDataMap</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>651</span> </span><span class="WHIT">    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._triggered</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>652</span> </span><span class="WHIT">				</span><span class="NAME">_resetForm</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>653</span> </span><span class="WHIT">				</span><span class="NAME">this._editView.view.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>654</span> </span><span class="WHIT">				</span><span class="NAME">this._editView.editing</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>655</span> </span><span class="WHIT">				</span><span class="NAME">this.hDiv.scrollLeft</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>656</span> </span><span class="WHIT">				</span><span class="NAME">this.element.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">scrollLeft</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>657</span> </span><span class="WHIT">    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>658</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>659</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>660</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>661</span> </span><span class="WHIT">    </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>662</span> </span><span class="WHIT">    	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">self._allEditMode</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">self._globalEditable</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>663</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>664</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'>665</span> </span><span class="WHIT">	</span><span class="COMM">//建立rowId与原生行数据的一一映射。</span><span class="WHIT">
<span class='line'>666</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_buildRowIdDataMap</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>667</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rowsData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.getData</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">rows</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>668</span> </span><span class="WHIT">    	</span><span class="NAME">self._rowIdDataMap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>669</span> </span><span class="WHIT">    	</span><span class="NAME">self._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>670</span> </span><span class="WHIT">    		</span><span class="COMM">//行的索引与原生数据的映射，方便通过rowId获取原生行的数据。</span><span class="WHIT">
<span class='line'>671</span> </span><span class="WHIT">    		</span><span class="NAME">self._rowIdDataMap</span><span class="PUNC">[</span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rowsData</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>672</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>673</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>674</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>675</span> </span><span class="WHIT">	</span><span class="COMM">//重置校验表单，同时清除错误信息</span><span class="WHIT">
<span class='line'>676</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_resetForm</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>677</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._validator</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>678</span> </span><span class="WHIT">			</span><span class="NAME">self._validator.resetForm</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>679</span> </span><span class="WHIT">			</span><span class="COMM">//清空错误信息</span><span class="WHIT">
<span class='line'>680</span> </span><span class="WHIT">			</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">self._errorHolders</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">holder</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>681</span> </span><span class="WHIT">    			</span><span class="NAME">holder.empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>682</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>683</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>684</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>685</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>686</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_hasChange</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>687</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">changeData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._changeData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>688</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">(</span><span class="NAME">$.isEmptyObject</span><span class="PUNC">(</span><span class="NAME">changeData</span><span class="PUNC">[</span><span class="STRN">"update"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">$.isEmptyObject</span><span class="PUNC">(</span><span class="NAME">changeData</span><span class="PUNC">[</span><span class="STRN">"insert"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">$.isEmptyObject</span><span class="PUNC">(</span><span class="NAME">changeData</span><span class="PUNC">[</span><span class="STRN">"delete"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>689</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>690</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>691</span> </span><span class="WHIT">    </span><span class="COMM">//显示可编辑的视图</span><span class="WHIT">
<span class='line'>692</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_showEditView</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>693</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>694</span> </span><span class="WHIT">			</span><span class="NAME">$editView</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.next</span><span class="PUNC">(</span><span class="STRN">".grid-edit-view"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>695</span> </span><span class="WHIT">			</span><span class="NAME">$editBtn</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>696</span> </span><span class="WHIT">			</span><span class="NAME">$editRow</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>697</span> </span><span class="WHIT">			</span><span class="NAME">position</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">position</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>698</span> </span><span class="WHIT">			</span><span class="NAME">scrollTop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">scrollTop</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>699</span> </span><span class="WHIT">			</span><span class="NAME">ops</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>700</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$editView.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>701</span> </span><span class="WHIT">			</span><span class="NAME">$editView</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">"&lt;div class='grid-edit-view'>&lt;div class='body-wrapper'>&lt;div class='grid-edit-row'>&lt;form class='grid-edit-form'>&lt;/form>&lt;/div>"</span><span class="WHIT">
<span class='line'>702</span> </span><span class="WHIT">					</span><span class="PUNC">+</span><span class="STRN">"&lt;div class='gird-edit-btn'>&lt;input type='button' class='ok' value='确定'/>&lt;input type='button' class='cancel' value='取消'/>&lt;/div>&lt;/div>&lt;/div>"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>703</span> </span><span class="WHIT">				</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">$elem.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>704</span> </span><span class="WHIT">				</span><span class="PUNC">.</span><span class="NAME">insertAfter</span><span class="PUNC">(</span><span class="NAME">$elem</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>705</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$editBtn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$editView.find</span><span class="PUNC">(</span><span class="STRN">".gird-edit-btn"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>706</span> </span><span class="WHIT">			</span><span class="NAME">$editRow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$editBtn.prev</span><span class="PUNC">(</span><span class="STRN">".grid-edit-row"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>707</span> </span><span class="WHIT">			</span><span class="NAME">pos</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>708</span> </span><span class="WHIT">			</span><span class="NAME">self._editView</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">view</span><span class="PUNC">:</span><span class="NAME">$editView</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editRow</span><span class="PUNC">:</span><span class="NAME">$editRow</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">editBtn</span><span class="PUNC">:</span><span class="NAME">$editBtn</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="COMM">//进行缓存</span><span class="WHIT">
<span class='line'>709</span> </span><span class="WHIT">			</span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getEditBtnPosition</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT">			</span><span class="NAME">$editBtn.css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"left"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">pos.left</span><span class="PUNC">,</span><span class="STRN">"top"</span><span class="PUNC">:</span><span class="NAME">pos.top</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>711</span> </span><span class="WHIT">			</span><span class="COMM">//绑定按钮的事件</span><span class="WHIT">
<span class='line'>712</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$okBtn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$editBtn.find</span><span class="PUNC">(</span><span class="STRN">"input.ok"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">omButton</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>713</span> </span><span class="WHIT">				</span><span class="NAME">$cancelBtn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$editBtn.find</span><span class="PUNC">(</span><span class="STRN">"input.cancel"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">omButton</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>714</span> </span><span class="WHIT">			</span><span class="NAME">$okBtn.click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>715</span> </span><span class="WHIT">				</span><span class="COMM">//这里再次进行校验，主要是由于用户如果自己设置那些编辑输入域的值是不会触发校验的</span><span class="WHIT">
<span class='line'>716</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._validator</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">self._validator.form</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>717</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>718</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>719</span> </span><span class="WHIT">				</span><span class="COMM">//由于闭包的原因，这里不可以直接使用tr,不然永远都是指向同一个tr</span><span class="WHIT">
<span class='line'>720</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.find</span><span class="PUNC">(</span><span class="STRN">"tr[_grid_row_id='"</span><span class="PUNC">+</span><span class="NAME">self._editView.rowId</span><span class="PUNC">+</span><span class="STRN">"']"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>721</span> </span><span class="WHIT">				</span><span class="NAME">_saveEditValue</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>722</span> </span><span class="WHIT">				</span><span class="NAME">$editView.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>723</span> </span><span class="WHIT">				</span><span class="NAME">self._editView.editing</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>724</span> </span><span class="WHIT">				</span><span class="NAME">$okBtn.blur</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>725</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._rowAdding</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>726</span> </span><span class="WHIT">					</span><span class="NAME">self._refreshHeaderCheckBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">				 	</span><span class="WHIT">
<span class='line'>727</span> </span><span class="WHIT">				 	</span><span class="NAME">self._rowAdding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>728</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>729</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">index</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>730</span> </span><span class="WHIT">				</span><span class="NAME">ops.onAfterEdit</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">ops.onAfterEdit.call</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self._getRowData</span><span class="PUNC">(</span><span class="NAME">rowIndex</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>731</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>732</span> </span><span class="WHIT">			</span><span class="NAME">$cancelBtn.click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>733</span> </span><span class="WHIT">				</span><span class="NAME">self.cancelEdit</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>734</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>735</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>736</span> </span><span class="WHIT">		</span><span class="NAME">self._editView.rowId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//当前正在编辑的行的id</span><span class="WHIT">
<span class='line'>737</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._editView.editing</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//如果当前正在编辑，那么是需要进行动画的</span><span class="WHIT">
<span class='line'>738</span> </span><span class="WHIT">			</span><span class="NAME">$editView.animate</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"top"</span><span class="PUNC">:</span><span class="NAME">position.top</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">scrollTop</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"fast"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>739</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>740</span> </span><span class="WHIT">			</span><span class="NAME">$editView.css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"top"</span><span class="PUNC">:</span><span class="NAME">position.top</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">scrollTop</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>741</span> </span><span class="WHIT">			</span><span class="NAME">self._editView.editing</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>742</span> </span><span class="WHIT">			</span><span class="NAME">$editView.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>743</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._colWidthResize</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>744</span> </span><span class="WHIT">				</span><span class="NAME">_resizeView</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>745</span> </span><span class="WHIT">				</span><span class="NAME">self._colWidthResize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>746</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>747</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>748</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>749</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>750</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_onResize</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>751</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this._triggered</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>752</span> </span><span class="WHIT">			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>753</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>754</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._editView.editing</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>755</span> </span><span class="WHIT">			</span><span class="NAME">this.element.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">scrollLeft</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>756</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>757</span> </span><span class="WHIT">			</span><span class="COMM">//在ff和chrome下，如果不用异步执行，位置计算不太准确，估计跟scrollLeft有关</span><span class="WHIT">
<span class='line'>758</span> </span><span class="WHIT">			</span><span class="NAME">setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>759</span> </span><span class="WHIT">				</span><span class="NAME">_resizeView</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>760</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>761</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>762</span> </span><span class="WHIT">			</span><span class="NAME">this._colWidthResize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>763</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>764</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>765</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>766</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>767</span> 	 * $col以及differWidth只在用鼠标改变标题列大小时才会有值，这种情况下，为了提高效率，只有被改变的列对应的编辑组件要改变宽度。
<span class='line'>768</span> 	 */</span><span class="WHIT">
<span class='line'>769</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_resizeView</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$col</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">differWidth</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>770</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>771</span> </span><span class="WHIT">			</span><span class="NAME">view</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._editView</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>772</span> </span><span class="WHIT">			</span><span class="NAME">$editView</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">view.view</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>773</span> </span><span class="WHIT">			</span><span class="NAME">scrollLeft</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">scrollLeft</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>774</span> </span><span class="WHIT">			</span><span class="NAME">$editBtn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">view.editBtn</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>775</span> </span><span class="WHIT">			</span><span class="NAME">updated</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>776</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'>777</span> </span><span class="WHIT">		</span><span class="NAME">$editView.width</span><span class="PUNC">(</span><span class="NAME">$elem.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>778</span> </span><span class="WHIT">		</span><span class="NAME">self._getHeaderCols</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">th</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>779</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">th</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"abbr"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>780</span> </span><span class="WHIT">				</span><span class="NAME">$th</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">th</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>781</span> </span><span class="WHIT">				</span><span class="NAME">target</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$col</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">$col.prop</span><span class="PUNC">(</span><span class="STRN">"abbr"</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="NAME">$th.prop</span><span class="PUNC">(</span><span class="STRN">"abbr"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>782</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>783</span> </span><span class="WHIT">				</span><span class="NAME">updated</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>784</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>785</span> </span><span class="WHIT">			</span><span class="COMM">//鼠标拖动列，目标列前面的列不变</span><span class="WHIT">
<span class='line'>786</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$col</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">updated</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>787</span> </span><span class="WHIT">				</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>788</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>789</span> </span><span class="WHIT">			</span><span class="WHIT">
<span class='line'>790</span> </span><span class="WHIT">			</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">self._editComps</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">comp</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>791</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$ins</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">comp.instance</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>792</span> </span><span class="WHIT">					</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">comp.type</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>793</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">comp.id</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>794</span> </span><span class="WHIT">					</span><span class="COMM">//鼠标拖动列，目标列后面的列改变left即可</span><span class="WHIT">
<span class='line'>795</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">target</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">$col</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>796</span> </span><span class="WHIT">						</span><span class="NAME">$ins.closest</span><span class="PUNC">(</span><span class="STRN">"div.grid-edit-wrapper"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="STRN">"left"</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"+="</span><span class="PUNC">+</span><span class="NAME">differWidth</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>797</span> </span><span class="WHIT">						</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>798</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>799</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">target</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>800</span> </span><span class="WHIT">						</span><span class="NAME">$ins.closest</span><span class="PUNC">(</span><span class="STRN">"div.grid-edit-wrapper"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">$th.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="STRN">"left"</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$th.position</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">left</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">scrollLeft</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>801</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>802</span> </span><span class="WHIT">					</span><span class="COMM">//改变编辑输入域组件的宽度</span><span class="WHIT">
<span class='line'>803</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="STRN">"omCalendar"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">"omCombo"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>804</span> </span><span class="WHIT">						</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$parent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$ins.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>805</span> </span><span class="WHIT">						</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="STRN">"omCalendar"</span><span class="PUNC">==</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>806</span> </span><span class="WHIT">	   						</span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="NAME">$th.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="NUMB">24</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>807</span> </span><span class="WHIT">	   						</span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="NAME">$th.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$parent.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>808</span> </span><span class="WHIT">	   					</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>809</span> </span><span class="WHIT">	   						</span><span class="NAME">$ins.next</span><span class="PUNC">(</span><span class="STRN">"input"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">$th.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$parent.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$ins.next</span><span class="PUNC">(</span><span class="STRN">"input"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>810</span> </span><span class="WHIT">	   					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>811</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>812</span> </span><span class="WHIT">						</span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="NAME">$th.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$ins.outerWidth</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$ins.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>813</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>814</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>815</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>816</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>817</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getEditBtnPosition</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>818</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$col</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>819</span> </span><span class="WHIT">			</span><span class="NAME">$editBtn.animate</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"left"</span><span class="PUNC">:</span><span class="NAME">pos.left</span><span class="PUNC">,</span><span class="STRN">"top"</span><span class="PUNC">:</span><span class="NAME">pos.top</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="STRN">"fast"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>820</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>821</span> </span><span class="WHIT">			</span><span class="NAME">$editBtn.css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"left"</span><span class="PUNC">:</span><span class="NAME">pos.left</span><span class="PUNC">,</span><span class="STRN">"top"</span><span class="PUNC">:</span><span class="NAME">pos.top</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>822</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>823</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'>824</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>825</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>826</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_onResizable</span><span class="PUNC">(</span><span class="NAME">$th</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">differWidth</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>827</span> </span><span class="WHIT">    	</span><span class="COMM">//如果不是处于编辑状态，由于编辑条是隐藏状态的，这时候计算各个编辑组件宽度很可能会是错误的，所以非编辑状态下什么也不处理。留到显示编辑条时再做处理</span><span class="WHIT">
<span class='line'>828</span> </span><span class="WHIT">    	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">_isEditable</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this._triggered</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this._editView.editing</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>829</span> </span><span class="WHIT">    		</span><span class="NAME">this._colWidthResize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>830</span> </span><span class="WHIT">    		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>831</span> </span><span class="WHIT">    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>832</span> </span><span class="WHIT">    	</span><span class="NAME">_resizeView</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$th</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">differWidth</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>833</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>834</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>835</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_saveEditValue</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>836</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>837</span> </span><span class="WHIT">			</span><span class="NAME">$editRow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._editView.editRow</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>838</span> </span><span class="WHIT">			</span><span class="NAME">comps</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._editComps</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>839</span> </span><span class="WHIT">			</span><span class="NAME">rowId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>840</span> </span><span class="WHIT">			</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getTrs</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">index</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>841</span> </span><span class="WHIT">			</span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getRowData</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>842</span> </span><span class="WHIT">			</span><span class="WHIT">
<span class='line'>843</span> </span><span class="WHIT">		</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">comps</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">comp</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>844</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">comp.model.name</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>845</span> </span><span class="WHIT">				</span><span class="NAME">newValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getCompValue</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">comp</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>846</span> </span><span class="WHIT">				</span><span class="NAME">originalValue</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>847</span> </span><span class="WHIT">				</span><span class="NAME">html</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>848</span> </span><span class="WHIT">				</span><span class="NAME">updateRowData</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>849</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>850</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$tr.attr</span><span class="PUNC">(</span><span class="STRN">"_insert"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>851</span> </span><span class="WHIT">				</span><span class="NAME">self._changeData.insert</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>852</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>853</span> </span><span class="WHIT">				</span><span class="NAME">originalValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowData</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>854</span> </span><span class="WHIT">				</span><span class="NAME">updateRowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._changeData.update</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>855</span> </span><span class="WHIT">				</span><span class="COMM">//注意，""==0为true,false==""为true,这里为了正确进行比较，全部转化为字符串再进行比较。</span><span class="WHIT">
<span class='line'>856</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">String</span><span class="PUNC">(</span><span class="NAME">newValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">(</span><span class="NAME">originalValue</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>857</span> </span><span class="WHIT">					</span><span class="NAME">_toggleDirtyFlag</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">comp.model</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>858</span> </span><span class="WHIT">					</span><span class="NAME">updateRowData</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">updateRowData</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>859</span> </span><span class="WHIT">					</span><span class="NAME">$.isEmptyObject</span><span class="PUNC">(</span><span class="NAME">updateRowData</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">self._changeData.update</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>860</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>861</span> </span><span class="WHIT">					</span><span class="NAME">_toggleDirtyFlag</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">comp.model</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>862</span> </span><span class="WHIT">					</span><span class="NAME">updateRowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._changeData.update</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">updateRowData</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>863</span> </span><span class="WHIT">					</span><span class="NAME">updateRowData</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>864</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>865</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>866</span> </span><span class="WHIT">			</span><span class="COMM">//更新回表格</span><span class="WHIT">
<span class='line'>867</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">comp.model.renderer</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>868</span> </span><span class="WHIT">				</span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">comp.model.renderer</span><span class="PUNC">(</span><span class="NAME">newValue</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>869</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>870</span> </span><span class="WHIT">				</span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newValue</span><span class="PUNC">==</span><span class="NAME">undefined</span><span class="PUNC">?</span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">newValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>871</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>872</span> </span><span class="WHIT">			</span><span class="NAME">$tr.find</span><span class="PUNC">(</span><span class="STRN">"td[abbr='"</span><span class="PUNC">+</span><span class="NAME">key</span><span class="PUNC">+</span><span class="STRN">"'] >div"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">html</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>873</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>874</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>875</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>876</span> </span><span class="WHIT">	</span><span class="COMM">//更换更改标志样式，show=true表示显示数据已被更改样式</span><span class="WHIT">
<span class='line'>877</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_toggleDirtyFlag</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">model</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">show</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>878</span> </span><span class="WHIT">		</span><span class="NAME">$tr.find</span><span class="PUNC">(</span><span class="STRN">"td[abbr='"</span><span class="PUNC">+</span><span class="NAME">model.name</span><span class="PUNC">+</span><span class="STRN">"']"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toggleClass</span><span class="PUNC">(</span><span class="STRN">"grid-cell-dirty"</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">show</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>879</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>880</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>881</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>882</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"_grid_row_id"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>883</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>884</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>885</span> </span><span class="WHIT">	</span><span class="COMM">//获取编辑条中列对应的组件的值</span><span class="WHIT">
<span class='line'>886</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_getCompValue</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">comp</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>887</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>888</span> </span><span class="WHIT">			</span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowData</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>889</span> </span><span class="WHIT">			</span><span class="NAME">$ins</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">comp.instance</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>890</span> </span><span class="WHIT">		</span><span class="KEYW">switch</span><span class="PUNC">(</span><span class="NAME">comp.type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>891</span> </span><span class="WHIT">		</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"omCalendar"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>892</span> </span><span class="WHIT">			</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$ins.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>893</span> </span><span class="WHIT">		</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"omNumberField"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>894</span> </span><span class="WHIT">			</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$ins.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>895</span> </span><span class="WHIT">			</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>896</span> </span><span class="WHIT">		</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"omCombo"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>897</span> </span><span class="WHIT">			</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$ins.omCombo</span><span class="PUNC">(</span><span class="STRN">"value"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>898</span> </span><span class="WHIT">			</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>899</span> </span><span class="WHIT">		</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"text"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>900</span> </span><span class="WHIT">			</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$ins.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>901</span> </span><span class="WHIT">			</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>902</span> </span><span class="WHIT">		</span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"custom"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>903</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">comp.model.editor.getValue</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>904</span> </span><span class="WHIT">				</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">comp.model.editor.getValue.call</span><span class="PUNC">(</span><span class="NAME">$ins</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowData</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">comp.model.name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>905</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>906</span> </span><span class="WHIT">		</span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>907</span> </span><span class="WHIT">			</span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>908</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>909</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>910</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>911</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>912</span> </span><span class="WHIT">	</span><span class="COMM">//获取某列最新的值，如果是新增的，从新增里边获取，如果更新过了，从更新里边获取最新值</span><span class="WHIT">
<span class='line'>913</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_getLastValue</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">model</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>914</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>915</span> </span><span class="WHIT">			</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">model.name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>916</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$tr.attr</span><span class="PUNC">(</span><span class="STRN">"_insert"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>917</span> </span><span class="WHIT">			</span><span class="COMM">//新增的话从insert里边拿到最新的值</span><span class="WHIT">
<span class='line'>918</span> </span><span class="WHIT">			</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowData</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>919</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>920</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">updateData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._changeData.update</span><span class="PUNC">[</span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>921</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">updateData</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">updateData</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//此数据被更新过了</span><span class="WHIT">
<span class='line'>922</span> </span><span class="WHIT">				</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">updateData</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="COMM">//最新值</span><span class="WHIT">
<span class='line'>923</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="COMM">//获取原始值</span><span class="WHIT">
<span class='line'>924</span> </span><span class="WHIT">				</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowData</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$tr</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>925</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>926</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>927</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>928</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>929</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>930</span> </span><span class="WHIT">	</span><span class="COMM">//获取原始行数据，如果是新添加进去的，获取的是新添加进去的行数据</span><span class="WHIT">
<span class='line'>931</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_getRowData</span><span class="PUNC">(</span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>932</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rowId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getRowId</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>933</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">tr</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"_insert"</span><span class="PUNC">)</span><span class="PUNC">?</span><span class="NAME">self._changeData.insert</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">self._rowIdDataMap</span><span class="PUNC">[</span><span class="NAME">rowId</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>934</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>935</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>936</span> </span><span class="WHIT">	</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_bindValidation</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>937</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$editForm</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._editView.editRow.find</span><span class="PUNC">(</span><span class="STRN">">.grid-edit-form"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>938</span> </span><span class="WHIT">			</span><span class="NAME">valiCfg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>939</span> </span><span class="WHIT">			</span><span class="NAME">rules</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">valiCfg.rules</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>940</span> </span><span class="WHIT">			</span><span class="NAME">messages</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">valiCfg.messages</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>941</span> </span><span class="WHIT">			</span><span class="NAME">colModel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getColModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>942</span> </span><span class="WHIT">		</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">colModel</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">model</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>943</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">customRules</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">model.editor.rules</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>944</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">customRules</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>945</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rules</span><span class="PUNC">[</span><span class="NAME">model.editor.name</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">model.name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>946</span> </span><span class="WHIT">					</span><span class="NAME">msg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">messages</span><span class="PUNC">[</span><span class="NAME">model.editor.name</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">model.name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>947</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">customRules.length</span><span class="PUNC">></span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">$.isArray</span><span class="PUNC">(</span><span class="NAME">customRules</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>948</span> </span><span class="WHIT">					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">temp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>949</span> </span><span class="WHIT">					</span><span class="NAME">temp.push</span><span class="PUNC">(</span><span class="NAME">customRules</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//包装成[[],[]]这种统一形式</span><span class="WHIT">
<span class='line'>950</span> </span><span class="WHIT">					</span><span class="NAME">customRules</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">temp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>951</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>952</span> </span><span class="WHIT">				</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">customRules.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>953</span> </span><span class="WHIT">					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">customRules</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="COMM">//检验类型</span><span class="WHIT">
<span class='line'>954</span> </span><span class="WHIT">					</span><span class="NAME">r</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">customRules</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">customRules</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//没有定义值的统一传 true</span><span class="WHIT">
<span class='line'>955</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">customRules</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>956</span> </span><span class="WHIT">						</span><span class="NAME">msg</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">customRules</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>957</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>958</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>959</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>960</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>961</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'>962</span> </span><span class="WHIT">		</span><span class="NAME">$.extend</span><span class="PUNC">(</span><span class="NAME">valiCfg</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>963</span> </span><span class="WHIT">			</span><span class="NAME">onkeyup</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">element</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>964</span> </span><span class="WHIT">				</span><span class="NAME">this.element</span><span class="PUNC">(</span><span class="NAME">element</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>965</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>966</span> </span><span class="WHIT">			</span><span class="COMM">//必须覆盖此方法，不然会默认生成错误信息容器，而错误信息的产生已经在showErrows处理了，所以此方法什么也不做</span><span class="WHIT">
<span class='line'>967</span> </span><span class="WHIT">			</span><span class="NAME">errorPlacement</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">element</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>968</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>969</span> </span><span class="WHIT">			</span><span class="NAME">showErrors</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">errorMap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorList</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>970</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">errorList</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">errorList.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>971</span> </span><span class="WHIT">		        	</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">errorList</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>972</span> </span><span class="WHIT">		        		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">obj.element</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>973</span> </span><span class="WHIT">		        			</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.attr</span><span class="PUNC">(</span><span class="STRN">"name"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>974</span> </span><span class="WHIT">		        		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">errorHolder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._errorHolders</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>975</span> </span><span class="WHIT">		        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">errorHolder</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>976</span> </span><span class="WHIT">		        			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">docPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$elem.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>977</span> </span><span class="WHIT">		        				</span><span class="NAME">tablePos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>978</span> </span><span class="WHIT">		        			</span><span class="NAME">errorHolder.css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">left</span><span class="PUNC">:</span><span class="NAME">docPos.left</span><span class="PUNC">-</span><span class="NAME">tablePos.left</span><span class="PUNC">+</span><span class="NAME">$elem.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">top</span><span class="PUNC">:</span><span class="NAME">docPos.top</span><span class="PUNC">-</span><span class="NAME">tablePos.top</span><span class="PUNC">+</span><span class="NAME">$elem.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">obj.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>979</span> </span><span class="WHIT">		        			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$elem.is</span><span class="PUNC">(</span><span class="STRN">":focus"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>980</span> </span><span class="WHIT">		        				</span><span class="NAME">errorHolder.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>981</span> </span><span class="WHIT">		        			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>982</span> </span><span class="WHIT">		        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>983</span> </span><span class="WHIT">	 	            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>984</span> </span><span class="WHIT">		    	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>985</span> </span><span class="WHIT">		    		</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">this.currentElements</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elem</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>986</span> </span><span class="WHIT">		    			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">errorHolder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._errorHolders</span><span class="PUNC">[</span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">elem</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"name"</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>987</span> </span><span class="WHIT">		    			</span><span class="NAME">errorHolder</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">errorHolder.empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>988</span> </span><span class="WHIT">		    		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>989</span> </span><span class="WHIT">		    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>990</span> </span><span class="WHIT">		    	</span><span class="COMM">//处理"确定"按钮的状态</span><span class="WHIT">
<span class='line'>991</span> </span><span class="WHIT">		    	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$okBtn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._editView.editBtn.find</span><span class="PUNC">(</span><span class="STRN">"input.ok"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>992</span> </span><span class="WHIT">		    		</span><span class="NAME">correct</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>993</span> </span><span class="WHIT">		    	</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">self._errorHolders</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorHolder</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>994</span> </span><span class="WHIT">		    		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">errorHolder.is</span><span class="PUNC">(</span><span class="STRN">":empty"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>995</span> </span><span class="WHIT">		    			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">correct</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>996</span> </span><span class="WHIT">		    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>997</span> </span><span class="WHIT">		    	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>998</span> </span><span class="WHIT">		    	</span><span class="NAME">correct</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">$okBtn.omButton</span><span class="PUNC">(</span><span class="STRN">"enable"</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">$okBtn.omButton</span><span class="PUNC">(</span><span class="STRN">"disable"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>999</span> </span><span class="WHIT">		    	</span><span class="NAME">this.defaultShowErrors</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1000</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1001</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1002</span> </span><span class="WHIT">		</span><span class="NAME">self._validator</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$editForm.validate</span><span class="PUNC">(</span><span class="NAME">valiCfg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1003</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'>1004</span> </span><span class="WHIT">		</span><span class="COMM">//绑定鼠标事件</span><span class="WHIT">
<span class='line'>1005</span> </span><span class="WHIT">		</span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">self._editComps</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">comp</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1006</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">editor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">comp.model.editor</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1007</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">editor.editable</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">editor.rules</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1008</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">editor.name</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">comp.model.name</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1009</span> </span><span class="WHIT">					</span><span class="NAME">errorHolder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._errorHolders</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1010</span> </span><span class="WHIT">					</span><span class="NAME">$target</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">comp.type</span><span class="PUNC">==</span><span class="STRN">"omCombo"</span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">comp.instance.next</span><span class="PUNC">(</span><span class="STRN">"input"</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="NAME">comp.instance</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1011</span> </span><span class="WHIT">					</span><span class="WHIT">
<span class='line'>1012</span> </span><span class="WHIT">				</span><span class="NAME">$target.mouseover</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1013</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">errorHolder</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">errorHolder.is</span><span class="PUNC">(</span><span class="STRN">":empty"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1014</span> </span><span class="WHIT">						</span><span class="NAME">errorHolder.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1015</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1016</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1017</span> </span><span class="WHIT">				</span><span class="PUNC">.</span><span class="NAME">mouseout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1018</span> </span><span class="WHIT">					</span><span class="NAME">errorHolder</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">errorHolder.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1019</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1020</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1021</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>1022</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1023</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">jQuery</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>